<template>
  <MidLayout>
    
    <IndexTitle right-text="查看全部" zh_text="案例展示" en_text="Space case" @handleRightText="handleRightText"></IndexTitle>
    <div class="row-gap-20">
      <ImageFont
        class="mid-image-font"
        v-for="indexCase in indexCaseList"
        @tap="goToExampleDetailPage(indexCase)"
        :key="indexCase.id"
        :image-path="indexCase.image"
      >
        <template #left>{{ indexCase.title }}</template>
      </ImageFont>
    </div>
  </MidLayout>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import IndexTitle from '@/pages/walls/index-title.vue'
import { defineProps } from 'vue'


defineProps({
  indexCaseList:{
    type:Array,
    default:[]
  }
})
const handleRightText = () => {
  uni.switchTab({
    url: `/pages/example/index`
  })
}

const goToExampleDetailPage = (item) => {
  uni.navigateTo({
    url: `/pages/example/detail?id=${item.id}`
  })
}
</script>

<style lang="scss" scoped>
.mid-image-font {
  margin-bottom: 15rpx;
}
</style>
